(add-to-load-path (dirname (current-filename)))

(use-modules (gnu home)
	     (gnu home-services)
	     (gnu home-services ssh)
	     (gnu home-services shells)
	     (gnu home-services files)
	     (gnu services)
	     (gnu packages admin)
             (guix gexp)
             (my-home packages) ;; %defines %my-packages
             )

(home-environment
 ;; the below is deprecated.
 ;; (home-directory "/home/joshua")
 ;; (symlink-name ".guix-home-env")
 (packages (map specification->package+output
                %my-packages))
 (services
  (list

    ;; (service sway-service-type
    ;;          (sway-configuration
    ;;           (user "joshua")
    ;;           (group "users")
    ;;           (variables
    ;;            (sway-variables-configuration
    ;;             (letter-left "n")
    ;;             (letter-right "s")
    ;;             (letter-up "t")
    ;;             (letter-down "h")
    ;;             (default-terminal "termite")
    ;;             (keyboard-layout (list "dvorak"))
    ;;             (xkb-options (list "ctrl:swapcaps"))
    ;;             (tap-to-click? #t)
    ;;             (natural-scroll? #t)
    ;;             ))
    ;;           (bindsyms
    ;;            (list %sway-basic-bindsyms
    ;;                  %sway-moving-around-bindsyms
    ;;                  %sway-layout-bindsyms
    ;;                  %sway-scratchpad-bindsyms
    ;;                  (sway-bindsym
    ;;                   (command "exec pactl set-sink-volume @DEFAULT_SINK@ +10%")
    ;;                   (key-combo "XF86AudioRaiseVolume"))
    ;;                  (sway-bindsym
    ;;                   (command "exec pactl set-sink-volume @DEFAULT_SINK@ -10%")
    ;;                   (key-combo "XF86AudioLowerVolume"))
    ;;                  (sway-bindsym
    ;;                   (command "exec pactl set-sink-mute @DEFAULT_SINK@ toggle")
    ;;                   (key-combo "XF86AudioMute"))
    ;;                  (sway-bindsym
    ;;                   (command "exec eject")
    ;;                   (key-combo "f9"))))))

   
   (service home-keyboard-service-type
           (keyboard-layout (keyboard-layout "us" "dvorak"
                                    #:model "thinkpad"
                                    #:options '("ctrl:swapcaps"))))

   ;; I should check out the home-state-service type to let me sync up my git repos:
   ;; https://git.sr.ht/~abcdw/rde/tree/master/item/gnu/home/examples/home-environment.tmpl
   ;; (service home-state-service-type
   ;;          (append
   ;;           (list
   ;;            (state-rsync "/home/bob/tmp/example-rsync-state/"
   ;;      		   "abcdw@olorin.lan:/var/services/homes/abcdw/tmp-state/")
   ;;            (state-git "/home/bob/tmp/talkes/"
   ;;      		 "git@git.sr.ht:~abcdw/rde"))))
   
   (service home-bash-service-type
            (home-bash-configuration
             (guix-defaults? #t)
             (bash-profile '("\ export HISTFILE=$XDG_CACHE_HOME/.bash_history;\n"
                             "if [[ -z $DISPLAY ]] && [[ $(tty) = /dev/tty3 ]]; then\n"
                             "# this may fix a bug that I have with termite confusing backspace as space in guix environment\n"
                             "# export TERM=linux\n"
                             "# shepherd -c /home/joshua/.config/shepherd/init.scm &\n"
                             "export MOZ_ENABLE_WAYLAND=1;\n"
                             "export GUIX_PACKAGE_PATH=/home/joshua/prog/gnu/guix/guix-packages/;\n"
                             "export XDG_DATA_DIRS=/var/lib/flatpak/exports/share:/home/joshua/.local/share/flatpak/exports/share:$XDG_DATA_DIRS;\n"
                             "exec dbus-run-session sway;\n"
                             "fi"
                             ))
             (bashrc
              '("alias lamora='ssh -p 63355 lamora'"))))

   (simple-service 'various-config-files
                   home-files-service-type
                   (list
                    ;; termite config
                    `("config/termite/config"
                           ,(local-file "config-files/termite-config"
                                        "config"))
                    
                    ;; sway config file
                    `("config/sway/config"
                           ,(local-file "config-files/sway-config"
                                        "config"))

                    ;; sway status.sh file
                    `("config/sway/status.sh"
                           ,(local-file "config-files/sway-status.sh"
                                        "status.sh"))
                         ))
   )))
